'use strict';

const Controller = require('egg').Controller;

class HomeController extends Controller {
  async index() {
    const { ctx,service } = this;
    const id = ctx.query.id;

    const res = await this.service.user.getUsers();
    await ctx.render('user',{ res });
    // ctx.body = 'xidian' + id;
  }
  async new() {
    const { ctx } = this;
    ctx.body = 'new Function';
  }
  async show() {
    const { ctx } = this;
    ctx.body = '欢迎来到西安电子科技大学';
  }
  async create() {
    const { ctx } = this;
    const data = ctx.request.body;
    // ctx.body = '欢迎来到西安电子科技大学';
    console.log(data);
    ctx.body = data;
  }
  
}

module.exports = HomeController;
